package zhh.tangbao.websocket.pojo;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * <p>
 *     描述
 * </p>
 * @author 粥灰灰
 * <p>2023/3/28</p>
 */

@Accessors(chain = true)
@Data
public class WebSocketMessageEntity {

    private String messageType;
    private String title;
    private Object content;

    public String toJsonString() {
        return JSONObject.toJSONString(this);
    }

    public WebSocketMessageEntity() {
    }

    public WebSocketMessageEntity(String messageType) {
        this.messageType = messageType;
    }

    public WebSocketMessageEntity(String messageType, Object content) {
        this.messageType = messageType;
        this.content = content;
    }
}
